/*

 Copyright (C) 2009 Team16
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License
for more details. You should have received a copy of the GNU General
Public License along with this program. If not, see <http://www.gnu.org/licens

  */
#ifndef MAINWINDOW_H
#include <QMainWindow>

#define MAINWINDOW_H


#include "highlighter.h"
#include <QLayout>
#include <QtGui/QLineEdit>
#include <QtGui/QPushButton>
#include <QDirModel>
#include <QTreeView>
#include <QTreeWidget>
#include "config.h"
#include "project.h"
#include "TextEditing/XQEditor.h"
#include "TextEditing/XQEdit.h"


QT_BEGIN_NAMESPACE
class QTextEdit;
QT_END_NAMESPACE
class config;
class projectC;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);

public slots:
    void about();
    void newFile();
    void saveFile(const QString &path = QString());
    void saveFileS();
    void openFile(const QString &path = QString());
    void openRec();
    void Setcurrent(const QString &path = QString(),const int tab=-2);
    void updateRecentFileActions();
    void treeclick(QModelIndex sd);
    void ProjectClean();
    bool CreateMakeFile();
    int ProjectBuild();
    void ProjectRun();
    void ProjectDebug();
    void ProjectBR();
    void ProjectBD();
    void QmakeBR();
    bool Qmake();
    bool ProjectQBuild();
    void ProjectQRun();
    void config_show();
    void project_config_show();
    void bf_proc();
    void tabChanged ( int );
    void tabCloseRequested ( int index );

    void svn_up();
    void svn_com();
    void svn_lg();
    void svn_co();
    void svn_add();
    void svn_remove();

    void close_current_tab();

private:
    QTextEdit *numberPage;
    void run_and_output(QString,QString,QTextEdit*);
    QString git_path,svn_path;
    QMap<QString,bool> tab_enabled;
    QTextEdit *svn_txt;

    QDockWidget *dock3;
    QDockWidget *dock_svn;
    QTabWidget *tabs;

    QStringList qenvir;
    QString qmakepath;
    QString mingwpath;
    config *cfg;

    projectC *project_config;

    QString buildpath;
    QString project;
    void setupEditor();
    void setupFileMenu();
    void setupHelpMenu();


    QAction *separatorAct;

    QAction *recents[5];


    //QTextEdit *editor;
    XQEditor *editor;





    QTextEdit *buildlog;
    Highlighter *logh;



    // project tab

     QDirModel model;
     QTreeView *tree;
     QString projst;
     QString curFile;


     QString defproj;

     // console tab
     QTextEdit *cons;

};
//! [0]

#endif


